package com.zhrj.exam.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhrj.apis.commons.ResultData;
import com.zhrj.exam.entity.ZhrjScadaEvent;
import com.zhrj.exam.mapper.ZhrjScadaEventMapper;
import com.zhrj.exam.service.IZhrjScadaEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhrj
 * @since 2023-03-14
 */
@Service
public class ZhrjScadaEventServiceImpl extends ServiceImpl<ZhrjScadaEventMapper, ZhrjScadaEvent> implements IZhrjScadaEventService {

    @Autowired
    private ZhrjScadaEventMapper zhrjScadaEventMapper;

    @Override
    public ResultData<ZhrjScadaEvent> getRTUStatusDataByCondition(Long devId, String startTime, String endTime) {
        List<ZhrjScadaEvent> zhrjScadaEventVoList = zhrjScadaEventMapper.getRTUStatusDataByCondition(devId, startTime, endTime);
        for (ZhrjScadaEvent zhrjScadaEvent : zhrjScadaEventVoList) {
            return ResultData.success(zhrjScadaEvent);
        }
        return null;
    }
}
